package com.tangxz.generate_code.example;

import com.tangxz.generate_code.generate.CodeGenerate;
import com.tangxz.generate_code.pojo.DataBaseVo;
import com.tangxz.generate_code.pojo.TableVo;
import com.tangxz.generate_code.pojo.TemplateVo;

import java.util.ArrayList;
import java.util.List;


public class CodeGenerateMany {
    public static void main(String[] args) {
        //1、数据库配置
        DataBaseVo dataBaseVo = new DataBaseVo("tangxz/database");
//        DataBaseVo dataBaseVo2 = new DataBaseVo("mysql", "com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306", "root", "root","jeecg-boot");
//        DataBaseVo dataBaseVo3 = new DataBaseVo("mysql", "com.mysql.jdbc.Driver", "localhost", "3306", "root", "root", "jeecg-boot");

        //2、代码生成器配置
        TemplateVo templateVo = new TemplateVo("tangxz/config");
//        TemplateVo templateVo2 = new TemplateVo("C:\\\\Users\\\\Administrator\\\\Desktop\\\\generate-code", "com.tangxz.module", "/tangxz/code-template/one", "src/main/java");
//        TemplateVo templateVo2 = new TemplateVo("com.tangxz.module", "/tangxz/code-template/one", "src/main/java");


        //3、需要生成的表
        List<TableVo> tableVoList = new ArrayList<>();


        //4、实例化代码生成器
        CodeGenerate codeGenerate = new CodeGenerate(templateVo,dataBaseVo);
//        CodeGenerate codeGenerate2 = new CodeGenerate("tangxz/database","tangxz/config");


        //5、根据需要生产的表生成代码
        codeGenerate.GeneratingFile(tableVoList);

    }
}
